Skip to main content

Configuration File

ApertureDB uses a configuration file (following a JSON format) that can be specified when starting the server using the “-cfg” flag:

./aperturedb -cfg config.json

If no configuration file is specified, ApertureDB will try to open the default file (config.json), and will fail to initiate if the file is not found.

Parameters​

All the parameters in the configuration file are optional, as ApertureDB has default values for all of them.

All parameters can also be specified as environment variables, using the prefix “ADB_” and the parameter name in upper case. For instance, the parameter “port” can be specified as “ADB_PORT”, and the parameter “session_token_max_age_sec” can be specified as “ADB_SESSION_TOKEN_MAX_AGE_SEC”.

Note that environment variables will override the values specified in the configuration file.

The following table describes commonly used parameters:

Parameter

Explanation

Default

master_key

The master key that initializes admin password on the first run.

"" (Range: any string)

port

TCP port for incoming connections

55555 (Range: 1-65535)

enable_health_port

Enable/disable the health check port

false (Range: true/false)

health_port

TCP port for health checks

55563 (Range: 1-65535)

timeout_receive

Enable/disable connection receive timeouts

true (Range: true/false)

max_simultaneous_clients

Number of max simultaneous connections open

500 (Range: >= 1)

max_connection_message_size_mb

Maximum size of the query/response message in MB. A value of 0 means use the default libcomm limit.

0 (Range: >= 0)

force_ssl

Flag that indicates whether or not SSL-based communication will be enforced by the server

true (Range: true/false)

db_root_path

Path to the root folder where all files/objects will be stored

db (Range: any valid path)

storage_type

Storage backend: ext4 for local files, s3 for S3, or gs for Google Cloud Storage.

"ext4"

storage_bucket_name

Bucket name for S3 or Google Cloud Storage.

""

storage_credentials

Storage credential JSON encoded as a string. See Deploying ApertureDB for credential examples.

"{}"

log_path

Directory where logs will be placed.

"/tmp" (Range: any valid path)

log_level

Levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively

1 (WARNING) (Range: 0-3)

verbose_log_level

Verbosity level beyond INFO, for debugging. Will set log_level = 0. Check Google glog documentation for details

-1 (no verbosity beyond INFO) (Range: >= -1)

log_cerr_threshold

Specify level of logging which will also be sent to stderr

3 (FATAL) (Range: 0-3)

enable_audit_logs

Enable/disable audit logs

false (Range: true/false)

include_audit_logs

When true, audit logs will be included in ApertureDB logs

false (Range: true/false)

kvgd_db_size

Maximum size of the graph database in MB

10 (Range: > 0)

kvgd_db_sync

Enable/disable sync operation to disk on every transaction. When disabled, latency will decrease but data loss may occur in case of crash

true (Range: true/false)

locale_name

Locale used for string comparison

en_US (Range: any valid locale)

zk_servers

Comma-separated list of Zookeeper server:port

"" (Range: any string)

zk_prefix

Same instance of Zookeeper can be used by multiple aperturedb clusters. Each cluster uses a different prefix to provide isolation between clusters. The config parameter zk_prefix specifies the path for the instance.

"testing" (Range: any string)

checkpoints_to_keep

Number of checkpoints that will be kept for recovery

4 (Range: > 0)

seconds_between_checkpoints

Interval in seconds between scheduled checkpoints. At least one new changelog is required; commit count does not trigger an earlier checkpoint.

7200 (2 hours) (Range: > 0)

collect_thread_interval

Number of seconds between collecting system status information

1 (Range: > 0)

collect_interval_set

An array of look-back intervals, in seconds, over which system status information is averaged

[5,10,30,120] (Range: array of ints 1-3600)

resources_check_mem_limit

Limit on percentage of memory utilization after which queries are stopped

93 (Range: 1-100)

resources_check_sleep

Number of seconds between resource utilization checks

2 (Range: > 0)

batch_time_to_live

Number of seconds that a batch is kept in memory before being cleaned up

60 (Range: >= 0)

batch_cleaner_interval

Number of seconds between batch cleanup operations

10 (Range: >= 0)

descriptorset_flusher_interval

Number of seconds between descriptor set cleanup operations

1800 (Range: >= 0)

session_token_max_age_sec

Maximum duration of a session, in seconds

36000 (Range: > 0)

refresh_token_max_age_sec

Maximum duration of a refresh token, in seconds

360000 (Range: > 0)

Config File Example​

This example sets common parameters to their default values. Parameters you omit use their defaults. For a new database, also set ADB_MASTER_KEY to a strong password before starting the server.

{
"port": 55555,
"max_simultaneous_clients": 500,
"max_connection_message_size_mb": 0,
"force_ssl": true,
"db_root_path": "db",
"storage_type": "ext4",
"log_path": "/tmp",
"log_level": 1,
"verbose_log_level": -1,
"log_cerr_threshold": 3,
"batch_cleaner_interval": 10,
"batch_time_to_live": 60,
"resources_check_sleep": 2,
"resources_check_mem_limit": 93,
"collect_thread_interval": 1,
"collect_interval_set": [5, 10, 30, 120]
}

Default Directories Structure​

By default, ApertureDB will create a directory structure as shown below:

db
├── acl
├── binlogs
├── descriptors
├── graph
├── objects
└── tmp